home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 92 / CDMM92_1.ISO / SOF 2 SDK / sof2sdk-101.msi / _92D6AC311BB48EBA344BBABC89DA6AB0 / _CE5B05F2D2B542E6B45466D094E81F63 < prev    next >
Encoding:
Text File  |  2002-06-05  |  7.3 KB  |  206 lines

  1. // Copyright (C) 2001-2002 Raven Software
  2. //
  3.  
  4. /*****************************************************************************
  5.  * name:        be_aas.h
  6.  *
  7.  * desc:        Area Awareness System, stuff exported to the AI
  8.  *
  9.  * $Archive: /source/code/botlib/be_aas.h $
  10.  * $Author: Mrelusive $ 
  11.  * $Revision: 2 $
  12.  * $Modtime: 10/05/99 3:32p $
  13.  * $Date: 10/05/99 3:42p $
  14.  *
  15.  *****************************************************************************/
  16.  
  17. #ifndef MAX_STRINGFIELD
  18. #define MAX_STRINGFIELD                80
  19. #endif
  20.  
  21. //travel flags
  22. #define TFL_INVALID                0x00000001    //traveling temporary not possible
  23. #define TFL_WALK                0x00000002    //walking
  24. #define TFL_CROUCH                0x00000004    //crouching
  25. #define TFL_BARRIERJUMP            0x00000008    //jumping onto a barrier
  26. #define TFL_JUMP                0x00000010    //jumping
  27. #define TFL_LADDER                0x00000020    //climbing a ladder
  28. #define TFL_WALKOFFLEDGE        0x00000080    //walking of a ledge
  29. #define TFL_SWIM                0x00000100    //swimming
  30. #define TFL_WATERJUMP            0x00000200    //jumping out of the water
  31. #define TFL_TELEPORT            0x00000400    //teleporting
  32. #define TFL_ELEVATOR            0x00000800    //elevator
  33. #define TFL_ROCKETJUMP            0x00001000    //rocket jumping
  34. #define TFL_BFGJUMP                0x00002000    //bfg jumping
  35. #define TFL_GRAPPLEHOOK            0x00004000    //grappling hook
  36. #define TFL_DOUBLEJUMP            0x00008000    //double jump
  37. #define TFL_RAMPJUMP            0x00010000    //ramp jump
  38. #define TFL_STRAFEJUMP            0x00020000    //strafe jump
  39. #define TFL_JUMPPAD                0x00040000    //jump pad
  40. #define TFL_AIR                    0x00080000    //travel through air
  41. #define TFL_WATER                0x00100000    //travel through water
  42. #define TFL_SLIME                0x00200000    //travel through slime
  43. #define TFL_LAVA                0x00400000    //travel through lava
  44. #define TFL_DONOTENTER            0x00800000    //travel through donotenter area
  45. #define TFL_FUNCBOB                0x01000000    //func bobbing
  46. #define TFL_FLIGHT                0x02000000    //flight
  47. #define TFL_BRIDGE                0x04000000    //move over a bridge
  48. //
  49. #define TFL_NOTTEAM1            0x08000000    //not team 1
  50. #define TFL_NOTTEAM2            0x10000000    //not team 2
  51.  
  52. //default travel flags
  53. #define TFL_DEFAULT    TFL_WALK|TFL_CROUCH|TFL_BARRIERJUMP|\
  54.     TFL_JUMP|TFL_LADDER|\
  55.     TFL_WALKOFFLEDGE|TFL_SWIM|TFL_WATERJUMP|\
  56.     TFL_TELEPORT|TFL_ELEVATOR|\
  57.     TFL_AIR|TFL_WATER|TFL_JUMPPAD|TFL_FUNCBOB
  58.  
  59. typedef enum
  60. {
  61.     SOLID_NOT,            // no interaction with other objects
  62.     SOLID_TRIGGER,        // only touch when inside, after moving
  63.     SOLID_BBOX,            // touch on edge
  64.     SOLID_BSP            // bsp clip, touch on edge
  65. } solid_t;
  66.  
  67. //a trace is returned when a box is swept through the AAS world
  68. typedef struct aas_trace_s
  69. {
  70.     qboolean    startsolid;    // if true, the initial point was in a solid area
  71.     float        fraction;    // time completed, 1.0 = didn't hit anything
  72.     vec3_t        endpos;        // final position
  73.     int            ent;        // entity blocking the trace
  74.     int            lastarea;    // last area the trace was in (zero if none)
  75.     int            area;        // area blocking the trace (zero if none)
  76.     int            planenum;    // number of the plane that was hit
  77. } aas_trace_t;
  78.  
  79. /* Defined in botlib.h
  80.  
  81. //bsp_trace_t hit surface
  82. typedef struct bsp_surface_s
  83. {
  84.     char name[16];
  85.     int flags;
  86.     int value;
  87. } bsp_surface_t;
  88.  
  89. //a trace is returned when a box is swept through the BSP world
  90. typedef struct bsp_trace_s
  91. {
  92.     qboolean        allsolid;    // if true, plane is not valid
  93.     qboolean        startsolid;    // if true, the initial point was in a solid area
  94.     float            fraction;    // time completed, 1.0 = didn't hit anything
  95.     vec3_t            endpos;        // final position
  96.     cplane_t        plane;        // surface normal at impact
  97.     float            exp_dist;    // expanded plane distance
  98.     int                sidenum;    // number of the brush side hit
  99.     bsp_surface_t    surface;    // hit surface
  100.     int                contents;    // contents on other side of surface hit
  101.     int                ent;        // number of entity hit
  102. } bsp_trace_t;
  103. //
  104. */
  105.  
  106. //entity info
  107. typedef struct aas_entityinfo_s
  108. {
  109.     int        valid;            // true if updated this frame
  110.     int        type;            // entity type
  111.     int        flags;            // entity flags
  112.     float    ltime;            // local time
  113.     float    update_time;    // time between last and current update
  114.     int        number;            // number of the entity
  115.     vec3_t    origin;            // origin of the entity
  116.     vec3_t    angles;            // angles of the model
  117.     vec3_t    old_origin;        // for lerping
  118.     vec3_t    lastvisorigin;    // last visible origin
  119.     vec3_t    mins;            // bounding box minimums
  120.     vec3_t    maxs;            // bounding box maximums
  121.     int        groundent;        // ground entity
  122.     int        solid;            // solid type
  123.     int        modelindex;        // model used
  124.     int        modelindex2;    // weapons, CTF flags, etc
  125.     int        frame;            // model frame number
  126.     int        event;            // impulse events -- muzzle flashes, footsteps, etc
  127.     int        eventParm;        // even parameter
  128.     int        gametypeitems;    // bit flags
  129.     int        weapon;            // determines weapon and flash model, etc
  130.     int        legsAnim;        // mask off ANIM_TOGGLEBIT
  131.     int        torsoAnim;        // mask off ANIM_TOGGLEBIT
  132. } aas_entityinfo_t;
  133.  
  134. // area info
  135. typedef struct aas_areainfo_s
  136. {
  137.     int contents;
  138.     int flags;
  139.     int presencetype;
  140.     int cluster;
  141.     vec3_t mins;
  142.     vec3_t maxs;
  143.     vec3_t center;
  144. } aas_areainfo_t;
  145.  
  146. // client movement prediction stop events, stop as soon as:
  147. #define SE_NONE                    0
  148. #define SE_HITGROUND            1        // the ground is hit
  149. #define SE_LEAVEGROUND            2        // there's no ground
  150. #define SE_ENTERWATER            4        // water is entered
  151. #define SE_ENTERSLIME            8        // slime is entered
  152. #define SE_ENTERLAVA            16        // lava is entered
  153. #define SE_HITGROUNDDAMAGE        32        // the ground is hit with damage
  154. #define SE_GAP                    64        // there's a gap
  155. #define SE_TOUCHJUMPPAD            128        // touching a jump pad area
  156. #define SE_TOUCHTELEPORTER        256        // touching teleporter
  157. #define SE_ENTERAREA            512        // the given stoparea is entered
  158. #define SE_HITGROUNDAREA        1024    // a ground face in the area is hit
  159. #define SE_HITBOUNDINGBOX        2048    // hit the specified bounding box
  160. #define SE_TOUCHCLUSTERPORTAL    4096    // touching a cluster portal
  161.  
  162. typedef struct aas_clientmove_s
  163. {
  164.     vec3_t endpos;            //position at the end of movement prediction
  165.     int endarea;            //area at end of movement prediction
  166.     vec3_t velocity;        //velocity at the end of movement prediction
  167.     aas_trace_t trace;        //last trace
  168.     int presencetype;        //presence type at end of movement prediction
  169.     int stopevent;            //event that made the prediction stop
  170.     int endcontents;        //contents at the end of movement prediction
  171.     float time;                //time predicted ahead
  172.     int frames;                //number of frames predicted ahead
  173. } aas_clientmove_t;
  174.  
  175. // alternate route goals
  176. #define ALTROUTEGOAL_ALL                1
  177. #define ALTROUTEGOAL_CLUSTERPORTALS        2
  178. #define ALTROUTEGOAL_VIEWPORTALS        4
  179.  
  180. typedef struct aas_altroutegoal_s
  181. {
  182.     vec3_t origin;
  183.     int areanum;
  184.     unsigned short starttraveltime;
  185.     unsigned short goaltraveltime;
  186.     unsigned short extratraveltime;
  187. } aas_altroutegoal_t;
  188.  
  189. // route prediction stop events
  190. #define RSE_NONE                0
  191. #define RSE_NOROUTE                1    //no route to goal
  192. #define RSE_USETRAVELTYPE        2    //stop as soon as on of the given travel types is used
  193. #define RSE_ENTERCONTENTS        4    //stop when entering the given contents
  194. #define RSE_ENTERAREA            8    //stop when entering the given area
  195.  
  196. typedef struct aas_predictroute_s
  197. {
  198.     vec3_t endpos;            //position at the end of movement prediction
  199.     int endarea;            //area at end of movement prediction
  200.     int stopevent;            //event that made the prediction stop
  201.     int endcontents;        //contents at the end of movement prediction
  202.     int endtravelflags;        //end travel flags
  203.     int numareas;            //number of areas predicted ahead
  204.     int time;                //time predicted ahead (in hundreth of a sec)
  205. } aas_predictroute_t;
  206.